1. Field of the Invention
The present invention generally relates to three-dimensional image display techniques and, more particularly, to a technique for displaying three-dimensional images by using polygons.
2. Description of the Related Art
One of the known techniques for displaying three-dimensional images is to use polygons. Generally, in the image displaying technique using polygons, the surface of a three-dimensional object having a complicated configuration is divided into polygons, and a pattern or a design, which is referred to as a xe2x80x9ctexturexe2x80x9d, is pasted on each polygon.
In this polygon-based image display technique, moving pictures can appear very realistic while requiring only a small amount of data compared to graphic images, such as photographs. Additionally, this polygon-based technique makes it possible to display three-dimensional images. Accordingly, with these advantages, the polygon-based techniques are widely used in game machines in which images must be quickly moved in response to player""s instructions. In view of this background, research is being conducted on the polygon-based image display techniques so as to reduce a load on game machines and also to display realistic images while providing three-dimensional effects.
Along with the use of polygons, attention is sometimes focussed on the advantage of displaying realistic images while requiring only a small amount of data. For example, if moving pictures created by using a large number of cell images are replaced by moving pictures using polygons, not only the load on the machines, but also human resources required for creating cell images, can be reduced.
However, polygon-based moving pictures appear very realistic because of its development purposes, and images consisting of edges and solid portions, which are generally unique to the moving pictures created by cell images, cannot be expressed very well by this polygon-based display technique. Accordingly, by using the polygon-based image display technique, moving pictures similar to those created by cell images cannot be obtained.
Accordingly, in view of this background, it is an object of the present invention to increase the range of applicability of a polygon-based image display technique by making it possible to add edges to polygon-based three-dimensional images.
In order to achieve the above object, according to one aspect of the present invention, there is provided a polygon-image display method for use in an apparatus for displaying a polygon image on a predetermined display unit, the polygon image being generated by combining basic polygons for rendering a three-dimensional object. The polygon-image display method includes the step of rendering a similar polygon, the reverse surface of which faces the obverse surface of the basic polygon. The similar polygon is larger than the basic polygon and has a similar shape to the basic polygon, and forms a pair with the basic polygon.
The above-described polygon-image display method utilizes the feature unique to the polygon-based image display technique. That is, for preventing image flickering, it is determined that polygons with their reverse surfaces facing a certain viewpoint are not seen. According to the above method, since an image of the similar polygon is displayed together with an image of the basic polygon, the entire three-dimensional object represented by a combination of the basic polygons is covered with the similar polygon, the reverse surface of which faces the obverse surface of the basic polygon. With this arrangement, the similar polygon which is pasted on the basic polygon and is located behind the basic polygon can be displayed as the edge of the three-dimensional object. In other words, the portion of the similar polygon outside the basic polygon can be used as the edge of the basic polygon.
As is seen from the foregoing description, since the similar polygon must be located outside the basic polygon, it is determined to be larger than the basic polygon. Additionally, the similar polygon used as an edge of the basic polygon has substantially the same thickness, and thus, the similar polygon has a similar shape to the basic polygon. Because of this figure, the similar polygon can be easily generated from the basic polygon data.
To promote edge enhancement of the similar polygon, a different texture from that of the basic polygon is pasted on the similar polygon.
In this case, the similar polygon may be created by being calculated based on the basic polygon data when a polygon image is displayed, or similar polygon data may be prepared to form a pair with the basic polygon data. In the second case, the similar polygon data may be stored in a storage unit, and may be displayed based on the similar polygon data. Also in the second case, calculations are not required for indicating the similar polygon, and thus, this technique can be extensively used not only for displaying predetermined images, but also for game fields in which images must be quickly displayed in response to player""s instructions.
According to the foregoing polygon-image display method, the center of gravity of the similar polygon may coincide with that of the corresponding basic polygon. With this arrangement, the widths of the portion of the similar polygon outside the basic polygon can be consistent, and can thus be suitably used as an edge of the basic polygon.
In the aforementioned method, the order of rendering the basic polygon and the similar polygon is not particularly restricted. Either of the polygons may be rendered first, or both the polygons may be rendered simultaneously. If the similar polygon is rendered first followed by rendering of the basic polygon, the basic polygon image is provided with a perimeter edge. That is, if a plurality of similar polygons or basic polygons overlap, the polygon closest to the viewpoint is preferentially displayed. Accordingly, by rendering the similar polygon first and then by pasting the basic polygon on the similar polygon, the portion of the similar polygon outside the adjacent basic polygons is located behind the basic polygons and is thus unseen on the polygon image. As a result, only the perimeter edge of a three-dimensional object represented by a set of basic polygons is displayed as viewed from the current viewpoint, thereby providing edge effects.
The above-described method may further include the steps of: detecting normal vectors of other basic polygon which are adjacent to each of the vertices of the basic polygon corresponding to the similar polygon; determining a unit vector having a direction identical to the direction of a sum vector of the normal vectors; setting the forward end of the unit vector to an edge point for each of the vertices of the basic polygon as an original point; and shifting the vertices of the similar polygon to the edge points.
With this arrangement, the vertices of the similar polygon which determine the width of the portion outside the basic polygon can be located away from the vertices of the basic polygons by the corresponding unit vectors. It is thus possible to maintain a constant width of the edge to be drawn by the outside portion of the similar polygon, thereby facilitating edge enhancement from an aesthetic point of view.
The above-described steps may be prepared when the data for rendering the similar polygon is created. In this case, by displaying only the similar polygon and the basic polygon, a sharp edge can be displayed without the need for performing specific calculations.
In the aforementioned method, the unit vector may be multiplied by a predetermined coefficient so as to determine a displacement vector, and the forward end of the displacement vector may be set to be the edge point for each of the vertices of the basic polygon as an original point, thereby shifting the vertices corresponding to the similar polygon to the edge points. With this arrangement, it is possible to draw each edge with a predetermined width by the portion of the similar polygon outside the basic polygon. This makes it possible to vary the thickness of the edges, thereby adding variation to the edges. The above-described coefficient may be the same for all the unit vectors or may be differentiated among the individual unit vectors. In the second case, a predetermined coefficient may be pre-assigned to each of the vertices of each basic polygon.
The foregoing polygon-image display method may be implemented in the following type of apparatus.
According to another aspect of the present invention, there is provided a polygon-image display apparatus including a storage unit for storing basic polygon data concerning a basic polygon for rendering a three-dimensional object and similar polygon data concerning a similar polygon which is larger than the basic polygon and has a similar shape to the basic polygon in such a manner that the basic polygon data and the similar polygon data correspond to each other. A control unit generates the basic polygon and the corresponding similar polygon, the reverse surface of which faces the obverse surface of the basic polygon, based on the basic polygon data and the similar polygon data, respectively, read from the storage unit, and also displays an image of the basic polygon and an image of the similar polygon which is disposed on the obverse surface of the basic polygon.
The foregoing polygon-image display method may be implemented by reading a corresponding program code recorded on a recording medium into a predetermined computer, for example, a computer specifically used as a game machine, or a personal computer.
According to still another aspect of the present invention, there is provided a computer-readable recording medium for storing a program code which causes a computer to execute processing. The processing includes the steps of: reading from a storage unit basic polygon data concerning a basic polygon for rendering a three-dimensional object and similar polygon data concerning a similar polygon which is larger than the basic polygon and has a similar shape to the basic polygon, and the reverse surface of which faces the obverse surface of the basic polygon; generating the basic polygon and the corresponding similar polygon based on the read basic polygon data and the read similar polygon data, respectively; and displaying a polygon image including an image of the basic polygon and an image of the similar polygon which is disposed on the obverse surface of the basic polygon.
The program code described in this specification encompasses the concept of not only the program itself, but also data required for executing a game on a game machine and control parameters.
According to a further aspect of the present invention, there is provided a polygon-image display method for use in an apparatus for displaying a polygon image on a predetermined display unit, the polygon image being generated by combining basic polygons for rendering a three-dimensional object. The polygon-image display method includes the steps of: extracting, from edges of each of the basic polygon, an edge including an edge which is not adjacent to any other basic polygons and an edge which is also part of another adjacent basic polygon which is unseen from a current viewpoint; and drawing a segment along the extracted edge.
In this method, by extracting the above-described edge and drawing a segment along the edge, an edge can be added to the basic polygon.
The indication xe2x80x9cbasic polygon is unseenxe2x80x9d means that basic polygon is located behind a front basic polygon or that the surface of the basic polygon which is not to be displayed faces a viewpoint. In the second case, for preventing image flickering, polygons with their reverse surfaces on are not generally displayed in displaying a polygon-based three-dimensional image. Thus, this characteristic of polygon is taken advantage of for forming an edge.
According to the above-described method, it is not necessary that the basic polygon is rendered first on a screen followed by the rendering of a segment. Regardless of which of the basic polygon and the segment is drawn first, it is sufficient if the segment is finally displayed along the outside of the edge of the basic polygon.
In drawing the segment, a different texture from that of the basic polygon may be disposed on the inside of each edge of the basic polygon by a predetermined width, or may be disposed on the outside of each edge of the basic polygon by a predetermined width. Alternatively, a different texture may be located both on the inside and the outside of each edge of the basic polygon.
In the aforementioned method, it is necessary not only to extract the edges which are not adjacent to other basic polygons, but also to extract the edges which are also part of another adjacent unseen polygon. The extraction of the second type of edges may be performed by any technique. For example, a normal vector of each of the basic polygon may be determined, and the inner product of the normal vector and a viewpoint vector in a viewing direction of the current viewpoint may be determined. Then, the edge which is adjacent to the unseen adjacent basic polygon may be extracted according to the sign of the inner product. Alternatively, order information concerning a predetermined order may be pre-assigned to one of each of the vertices and each of the edges of each of the basic polygons, and may be detected for each of the polygons so as to extract the edge which is adjacent to the unseen basic polygon according to the arrangement of the order information as viewed from the current viewpoint. In the second technique, it is determined whether the order of the information is arranged clockwise or counterclockwise as viewed from the current viewpoint.
In the above-described polygon-image display method, the segment may be drawn along the outside of the edge, and when the segment and the basic polygon overlap, the basic polygon may be preferentially displayed. With this arrangement, the segment which is at both edges adjacent to the basic polygons can be behind the basic polygons, so that it is not displayed on a polygon image. Accordingly, a three-dimensional object represented by a set of basic polygons is displayed only with the perimeter edge as viewed from the current viewpoint. That is, in this method, proper edging processing can be performed when displaying three-dimensional images.
In this method, it is necessary to draw a segment along the outside of the edge. Any kind of drawing technique may be employed, and one of which is as follows. In the aforementioned polygon-image display method, the step of drawing the segment may include the steps of: detecting normal vectors of each of the basic polygons which is adjacent to end points of the edge; determining a unit vector having a direction identical to the direction of a sum vector of the normal vectors; setting the forward end of the unit vector to an edge point for each of the end points of the edge as an original point and connecting the edge points to form another edge; and disposing an image having a different texture from the texture of the basic polygon between the edge of the basic polygon and the edge formed by connecting the edge points. According to this technique, the width of the segment is determined by the position of the edge points. Since the edge points are away from the vertices of the basic polygon by the unit vectors, the constant width of the segment can be maintained, thereby further promoting edge enhancement.
In the above-described technique, the step of drawing the segment may include the steps of: determining a displacement vector by multiplying the unit vector with a predetermined coefficient; setting the forward end of the displacement vector to an edge point for one of the end points of the edge as an original point; and disposing an image having a different texture from the texture of the basic polygon including the edge between the edge and another edge formed by connecting the original points.
With this arrangement, the segment having a predetermined width may be drawn, which makes it possible to vary the thickness of the segment, thereby adding variation to the resulting images. The above-described coefficient may be the same for all the unit vectors or may be differentiated among the unit vectors. In the second case, a predetermined coefficient may be pre-assigned to each of the vertices of each basic polygon.
The above-described polygon-image display method may be implemented in the following type of apparatus.
According to a yet further aspect of the present invention, there is provided a polygon-image display apparatus including a storage unit for storing basic polygon data concerning basic polygons for rendering a three-dimensional object. A control unit generates the basic polygons based on the basic polygon data read from the storage unit, and extracts, from edges of each of the basic polygons, an edge including an edge which is not adjacent to any other basic polygons and an edge which is also part of another adjacent basic polygon which is unseen from a current viewpoint. The control unit also generates a segment to be drawn along the edge, and displays a polygon image including an image of the basic polygon and an image of the segment on a predetermined display unit.
The foregoing polygon-image display method may be implemented by reading a corresponding program code recorded on a recording medium into a predetermined computer, such as a computer specifically used as a game machine or a personal computer.
According to a further aspect of the present invention, there is provided a computer-readable recording medium for storing a program code which causes a computer to execute processing. The processing includes the steps of: reading basic polygon data concerning a basic polygon for rendering a three-dimensional object; generating the three-dimensional object by a combination of the basic polygons based on the read data and generating an image of a similar polygon corresponding to each of the basic polygons; extracting, from edges of each of the basic polygons, an edge including an edge which is not adjacent to any other basic polygons and an edge which is also part of another adjacent basic polygon which is unseen from a current viewpoint; generating a segment to be drawn along the edge; and displaying an image of the basic polygon and an image of the segment on a predetermined display unit.